<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Loghouse</title>

    <link href="<%= url('vendor/bootstrap/css/bootstrap.min.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('vendor/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('vendor/select2/css/select2.min.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('vendor/select2/css/select2-bootstrap.min.css') %>" rel="stylesheet" type="text/css" />

    <link href="<%= url('assets/stylesheets/bootstrap-custom.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('assets/stylesheets/search-params.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('assets/stylesheets/super-date-picker.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('assets/stylesheets/logs.css') %>" rel="stylesheet" type="text/css" />
    <link href="<%= url('assets/stylesheets/main.css') %>" rel="stylesheet" type="text/css" />
  </head>
  <body>
    <nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container-fluid">
        <div class="navbar-header">
          <a class="navbar-brand" href="/">Loghouse</a>
        </div>
        <ul class="nav navbar-nav">
          <li <%= 'class="active"' if @tab.blank? %>><a href="/">Default query</a></li>
          <% @tab_queries.each do |q| %>
            <li class="<%= 'active' if @tab == q.id %>">
              <a href="/query?query_id=<%= q.id %>">
                <%= q.attributes[:name] %>
              </a>
            </li>
          <% end %>
          <li <%= 'class="active"' if @tab == :queries %>>
            <a href="/queries" data-toggle="tooltip" data-placement="bottom" title="Manage queries"><span class="glyphicon glyphicon-cog" aria-hidden="true"></span></a>
          </li>
          <li class="navbar-right">
            <a href="https://github.com/flant/loghouse/commit/<%= version %>" target="_blank">
              <span class="glyphicon glyphicon-link"></span>
              ver. <%= version %>
            </a>
          </li>
          <li class="navbar-right">
            <a href="javascript:void(0)">
              Welcome back, <%= User.current %>
            </a>
          </li>
        </ul>
      </div>
    </nav>

    <%= yield %>

    <script src="<%= url('vendor/jquery-3.2.1.min.js') %>" charset="utf-8"></script>
    <script src="<%= url('vendor/moment-with-locales.min.js') %>" charset="utf-8"></script>
    <script src="<%= url('vendor/bootstrap/js/bootstrap.min.js') %>" charset="utf-8"></script>
    <script src="<%= url('vendor/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js') %>" charset="utf-8"></script>
    <script src="<%= url('vendor/html.sortable.min.js') %>" charset="utf-8"></script>
    <script src="<%= url('vendor/select2/js/select2.full.min.js') %>" charset="utf-8"></script>
    <script src="<%= url('vendor/uri.js') %>" charset="utf-8"></script>

    <script src="<%= url('assets/javascripts/search-params.js') %>" charset="utf-8"></script>
    <script src="<%= url('assets/javascripts/main.js') %>" charset="utf-8"></script>
  </body>
</html>
